<?php
class MCmsPageForm extends MCmsPage
{
	public function rules()
	{
		return array(
			array('title,content,url', 'required'),
			array('url', 'unique', 'className' => 'MCmsPage', 'message' => $this->t('This URL is already taken.')),
			array('mainMenu,footerMenu', 'safe'),
		);
	}
	
	public function attributeLabels()
	{
		return array(
			'title' => $this->t('Title'),
			'url' => $this->t('URL'),
			'content' => $this->t('Content'),
			'mainMenu' => $this->t('Add to the main menu'),
			'footerMenu' => $this->t('Add to the footer menu'),
		);
	}
	
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}
}